age = 20

if age > 18:
    print("成年")
elif age < 18:
    print("未成年")

l = [1, 2, 3, 4, 5, 6, 7, 8, 9]

print("=" * 100)

# 增强for循环
for i in l:
    print(i)

d = {"001": "java", "002": "python", "003": "scala"}

print(d.items())
for k, v in d.items():
    print(k, v)

i = 0

sum = 0

while i <= 10:
    sum += i
    i += 1

print(sum)

# 列表推导式


l = [1, 2, 3, 5, 6, 7, 8, 9]
l2 = []
for i in l:
    l2.append(i * 2)

print(l2)

# 列表推导式
l3 = [i * 2 for i in l]
print(l3)
